<html>
<head><meta charset="utf-8"><title>needless_bool · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/needless_bool.html">needless_bool</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214326270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/needless_bool/near/214326270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/needless_bool.html#214326270">(Oct 23 2020 at 15:14)</a>:</h4>
<p>I'm trying to fix <a href="https://github.com/rust-lang/rust-clippy/issues/3973">https://github.com/rust-lang/rust-clippy/issues/3973</a>, so naturally I saw the closed PR <a href="https://github.com/rust-lang/rust-clippy/pull/3983">https://github.com/rust-lang/rust-clippy/pull/3983</a>.<br>
This comment <a href="https://github.com/rust-lang/rust-clippy/pull/3983#discussion_r276552937">https://github.com/rust-lang/rust-clippy/pull/3983#discussion_r276552937</a> made a lot of sense to me.</p>
<p>I cannot make the lint triggers because of a unary test implemented in <a href="https://github.com/rust-lang/rust-clippy/pull/5365">https://github.com/rust-lang/rust-clippy/pull/5365</a>.<br>
The unary test is this one: <a href="https://github.com/rust-lang/rust-clippy/pull/5365/files#diff-ed7759c6e78c5d300dc98807b3c2eff9d2467f6c6f1bb10ba56e06f62ff37ffbR239">https://github.com/rust-lang/rust-clippy/pull/5365/files#diff-ed7759c6e78c5d300dc98807b3c2eff9d2467f6c6f1bb10ba56e06f62ff37ffbR239</a>.</p>
<p>Shall we consider this PR as well implemented so we can close the issue <a href="https://github.com/rust-lang/rust/issues/3973">#3973</a>? Or should we change this behavior to allow linting back in macros?</p>



<a name="214327700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/needless_bool/near/214327700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/needless_bool.html#214327700">(Oct 23 2020 at 15:27)</a>:</h4>
<p>ah weird, it works on playground, but not locally, something is broken on my end ^^</p>



<a name="214335599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/needless_bool/near/214335599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ThibsG <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/needless_bool.html#214335599">(Oct 23 2020 at 16:34)</a>:</h4>
<p>I found why: <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=04f1c718bc4841f579050c71517dbbc4">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=04f1c718bc4841f579050c71517dbbc4</a><br>
if you compare with a boolean literal, it lints.<br>
if you compare with a boolean variable, it doesn't.</p>



<a name="214456730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/needless_bool/near/214456730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eduardo Broto <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/needless_bool.html#214456730">(Oct 24 2020 at 23:55)</a>:</h4>
<p><span class="user-mention" data-user-id="342307">@ThibsG</span> sorry for not addressing your question on time, there has been a spike of work related to hacktoberfest and couldn't find the time to dig into it.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>